• Home
  • Training Books
  • Subscribe to Our Email Newsletter
  • About
    • Contributors
    • Feedback
    • Contact
    • Privacy policy
    • Cookie Policy

CADnotes

CAD Tutorials and Best Practices for professionals and students

  • Featured
  • AutoCAD
    • AutoLISP
  • Revit
    • Revit Architecture Basic
    • Revit MEP Basic Tutorial
  • Inventor
  • MicroStation
    • MicroStation Basic Tutorial
You are here: Home / AutoCAD / How to use the AutoCAD status line to provide real time reporting

How to use the AutoCAD status line to provide real time reporting

April 28, 2011 by Paul Munford 7 Comments

In this Article...

  • How do I edit the AutoCAD status line?
  • How do I add feedback from system variables?
    • Could you give me some examples?
  • How do I save my new value for MODEMACRO?
  • How do I define the MODEMACRO value using a start up script?
  • How do I define the MODEMACRO value using LISP?
  • I’d like to find out more about Diesel

This guest post is by Paul Munford of CAD Setter Out. Great post Paul!

Did you ever notice the AutoCAD Status Line? It just provides the coordinates of the cursor right? Did you know that you can also use the Status Line to provide real time reports from system variables?

Would you like to see which command you where using when AutoCAD hung up? Would you like to see what Profile one of your team is using? Would you like to know how long you’ve had a drawing file open? And would you like to have all this information (and more!) displayed to you in real time in the AutoCAD status line?

clip_image002

The Status Line

How do I edit the AutoCAD status line?

The value in the status line is a string (some text). By default the value is set to “” i.e. an empty string. We can edit this value using the ‘MODEMACRO’ command.

Type ‘MODEMACRO’ at the command line.

Command: MODEMACRO
Enter new value for MODEMACRO, or . for none <" ">:

Type ‘Hello Mum’ and hit return.

clip_image004

The Status Line with a personalised message

Well done! You have now added your own message to the status line!

How do I add feedback from system variables?

The Modemacro value accepts strings which include DIESEL expressions (‘Diesel’ = Direct Interactively Evaluated String Expression Language).

We can use Diesel to grab the values of the AutoCAD system variables we wish to examine, and stuff them into the Status Line.

The Diesel expression used to get an system variable is:

$(getvar, varname)

‘$ ()’ tells AutoCAD that the following string contained within the brackets will need to be evaluated by the Diesel interpreter.

‘getvar’ is short for ‘Get the value from an system Variable’ (this is a Diesel function)

‘,’ separates the function (what the Diesel expression needs to do) from the Arguments (what information the Diesel expression will perform the function on)

‘varname’ should be replaced by the name of the system variable that you wish to examine (This value is the argument).

Could you give me some examples?

Here are some examples of using Diesel expressions to return system variables to the status line:

$(getvar, cprofile) – Displays the current user’s profile

$(getvar, cmdnames) – Displays the current command.

Diesel expressions can also be nested.

$(substr,$(*, $(getvar, tdindwg), 24),1,3) – Display’s the total editing time.

The expression above takes the value of the ‘TDINDWG’ system variable, multiplies it by 24 (to get the time the user has been in the DWG file in hours) and then truncates the resulting string by only returning the first four characters.

Finally, you can string a whole load of Diesel expressions and regular text strings together to make the Status Line more readable.

Changing the ‘MODEMACRO’ value to this:

LOGIN: $(Getvar,LOGINNAME) | PROFILE: $(Getvar,CPROFILE) | WORKSPACE: $(Getvar,WSCURRENT) | COMMAND: $(if,$(eq,$(Getvar,cmdnames),""),Waiting...,$(GETVAR, cmdnames))

Would give us a status line that looks like this:

clip_image006

Tip: Find out how to get a full list of system variables using the ‘SYSVAR’ command or the AutoCAD express tool ‘System variable editor’.

How do I save my new value for MODEMACRO?

The value of the Modemacro string is not saved from session to session. To set up your own personalized value, you will need to use a start up script or LISP file to replace this value at the beginning of every session.

A Start up Script is ideal for AutoCAD LT. If you are working with AutoCAD in a networked office environment I recommend using the ACAD.LSP.

How do I define the MODEMACRO value using a start up script?

Create a new blank ASCII text document. Add the following lines:

Modemacro
LAYER: $(getvar,clayer) '(replace this code with your own Diesel expression)

Close the text file and change its name to ‘STARTUP.SCR’ make sure that your script is saved in one of AutoCAD’s search paths.

Now close AutoCAD and go to your desk top. Right click on your AutoCAD start up short cut icon and add the following code in the ‘Target’ box:

/b STARTUP

‘/b’ stands for ‘Batch processes. Your start up script will run as soon as AutoCAD opens.

TIP: The maximum length of the string that you can enter with the ‘MODEMACRO’ command is 255 Characters. If you need to add more than this use ‘SETVAR’ instead.

clip_image008

How do I define the MODEMACRO value using LISP?

The place to add a LISP routine to define the Modemacro Value is in your ACAD.LSP.

To add an ACAD.LSP file, create a new blank ASCII text document. Add the following lines:

(SETVAR "modemacro"
(STRCAT "LAYER: $(getvar,clayer)")
;(replace this code with your own Diesel expression)
;end setvar

Close the text file and change its name to ‘ACAD.LSP’ make sure that your Lisp file is saved in one of AutoCAD’s search paths.

The ACAD.LSP file is automatically run when AutoCAD starts up.

Tip: The maximum string length for the ‘MODEMACRO’ variable is 4095 characters.

I’d like to find out more about Diesel

If you would like to find out more about Diesel, check out these web sites:

Dietmar Rudolph’s Diesel reference page

Ralph Grabowski’s ‘How to write a Diesel Macro

About Paul Munford

Paul Munford is the CAD/CAM manager at Halstock cabinet makers in the UK. Paul is a contributor to AUGIworld and D3D Magazine, and has been a speaker at Autodesk University for the last three years.
Paul is a firm believer that your CAD software shouldn't hinder your creativity or productivity and writes awesome tips, tricks and tutorials for AutoCAD and Autodesk Inventor on his blog Cadsetterout.com.
Paul Is currently working on his first eBook '101 AutoCADTips' You can find out more here:
http://cadsetterout.com/coming-soon-101-autocad-tips/

Filed Under: AutoCAD Tagged With: macro, status line

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

7 Comments
Inline Feedbacks
View all comments
JOHN
JOHN
10 years ago

Is there a way to use the FIND command and have its ‘total found’ value captured for a number of strings?

For instance, I have MLEADERS with values from 1-100, and various quantity for each value (five MLEADERS with the number 7 in them, etc…) and I usually use the find command and look for the number 7 while all mleaders are selected and it comes back and says 5.

I would like to automate that with a script… any recommendations?

0
Reply
Paul Munford
Paul Munford
Reply to  JOHN
10 years ago

Hi John.

You can definitely do this – it would involve some fairly lengthy scripting though!

I recommend that you ask for help on the ‘Swamp; AutoLISP forum:
http://www.theswamp.org/index.php?board=2.0

I think that the logic would go like this:
1. Trigger Lisp routine – this would need to be attached to an event, such as save or re-gen.
2. Run Lisp routine
2.1. Select all entities in the DWG file
2.2. Filter down to Mleaders
2.3. Filter down to Mleaders that contain ‘7’ in their text property
2.4. Count the number of items in the resulting set
3. Allocate the value to ModeMacro

Does this help?

Paul

0
Reply
Binu Mathew
Binu Mathew
10 years ago

Edwin, Thanks for your help to the Autodesk community

0
Reply
Gally
Gally
12 years ago

is it possible to make a report into this info? i.e. if you want print out reports of how long people are spending on drawings

0
Reply
Paul Munford
Paul Munford
14 years ago

I'm glad you liked it mini guy :)

I hope that you find the technique useful!

Paul (The CAD Setter Out)

0
Reply
the_mini_guy
the_mini_guy
14 years ago

Way cool.. :-)

0
Reply
ali
ali
Reply to  the_mini_guy
14 years ago

hebat222 ….

0
Reply
wpdiscuz   wpDiscuz

Featured

Free e-book: Working with AutoCAD Annotation Scaling

To celebrate CADnotes 8th anniversary, we provide this e-book for all readers. It is free. It covers how Annotation Scaling works and how to use it. We hope you will like it!

Recent Articles

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available

Advertisement

New on CADnotes

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available
  • Autodesk Forma Design Contest
  • Revit 2025: Toposolid Enhancements

Meet the Authors

avatar for
avatar for
avatar for
avatar for
avatar for
avatar for

Get Connected

CADnotes on FacebookCADnotes on InstagramCADnotes on TwitterCADnotes on YouTube

© 2009 – 2025 CADnotes · Feedback · Privacy Policy · Become an affiliate

wpDiscuz